#include "common.hpp"
#include "tile.hpp"
#include "ship.hpp"
#include "en.hpp"

/*
// placeholder SFML test
int main()
{
    // create the window
    sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
    sf::CircleShape  circle;
    sf::View view;
	view.setCenter(0,0);
	view.setSize(800, 600);
    circle.setRadius(30);
    circle.setPosition(-30,-30);

	view.setCenter(0,0);
	window.setView(view);

    // run the program as long as the window is open
    while (window.isOpen())
    {
        // check all the window's events that were triggered since the last iteration of the loop
        sf::Event event;
        while (window.pollEvent(event))
        {
            // "close requested" event: we close the window
            if (event.type == sf::Event::Closed)
                window.close();
        }

        // clear the window with black color
        window.clear(sf::Color::Black);

        // draw everything here...
        window.draw(circle);

        // end the current frame
        window.display();
    }

    return 0;
}
*/

int main()
{
	auto texPtr  = en::loadTex(  "testtex.png" );
	auto shipPtr = en::loadShip( "testsav.txt", texPtr );
	if(shipPtr)
	{
		std::cout << shipPtr->toString();

		en::window.create(sf::VideoMode(800, 600), "My window");
		en::window.clear(sf::Color::Black);
		en::window.draw(*shipPtr);
		en::window.display();

		std::cin.get();
	}
	else
	{
		std::cout << "NOPE\n";
	}

}
